<?php
	require_once($_SERVER["DOCUMENT_ROOT"]."/modules/security_mod.php");
	require_once($_SERVER["DOCUMENT_ROOT"]."/modules/account_mod.php");
        
        SecurityMod::login();
        
	$level = $_SESSION["account"]->getLevel();
	if ($level != "Admin")
		SecurityMod::logout();
        
	$user = AccountMod::getAccountByPid(intval($_REQUEST["pid"]));
        $zip = new ZipArchive();
	if (is_null($user)):
?>
<html>
User was not found.
</html>
<?php
	else:
?>
<html>
<head>
<title>Pardus Infocenter - User detail</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="main.css">
<link href="favicon.ico" type=image/x-icon rel="shortcut icon">
<script src="main.js" type="text/javascript"></script>
</head>
<body>
<div style="width: 450px; padding: 5px; border-style: solid; border-width: 1px; border-color: greenyellow; margin-left: auto; margin-right: auto;">
    <b>Hello <?php echo($user->getName())?>,</b><br /><br />

You have been granted the permissions to use the Federation Infocentre database and scripts.
Please follow the instructions below to install everything properly.<br />
Please save this message on a safe place so you can refer to it later.<br /><br />
After installing everything successfully please confirm in the chat that everything is working for you.<br /><br />

<b>Access information:</b><br />
Infocentre URL: <?php echo("http://".$_SERVER["SERVER_NAME"])?><br />
Username: <?php echo($user->getName())?><br />
Password: <?php echo($user->getPassword())?><br />
Validation code: <?php echo($user->getValidation())?><br /><br />

<b>Instructions:</b><br />
1) Go to the Infocentre site and log in with your username and password<br />
2) Go to the GM Scripts section and install both (!!!) DynaScript scripts<br />
3) Go back to the Pardus site and refresh it using F5 key<br />
4) Go to Options screen in Pardus and find the DynaScript (DS) Control Panel at the very bottom<br />
5) Enter the Validation Code (see above) into the Code field<br />
6) Push the "Check for script updates" button to fetch the scripts available for you (this is done automatically every day so you always get the most fresh versions)<br /><br />

By default all the downloaded scripts are installed automatically and updated whenever a new version becomes available. You can change this behavior by unchecking the checkboxes at the top of the control panel.<br /><br />

To change a script's settings you have to have it installed first. Then click on the script name (has to have orange color otherwise no settings are available) to open the settings panel. Changed settings are saved right after you change them. No Save button.<br /><br />

If you want to read instructions for the individual scripts, click on the respective link in the Script Description column. This will open the detailed description file in a new window/tab. I strongly suggest you to read the instructions before you start using the scripts.<br /><br />

To see the Federation Chat simply go to the Chat screen in Pardus and switch to Fed Chat tab. Use the username and password provided in the message when asked.<br /><br />

In case of any problems, please contact the Federation R&D Team<br /><br />

Thanks for using the Federation toolset<br /><br />

Carolus Rex<br />
Jirina<br />
Webxro<br />
</div>
</body>
</html>
<?php
	endif;
?>